package com.example.usermanagementsystem.controller;

import com.example.usermanagementsystem.domain.Employee;
import com.example.usermanagementsystem.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
/**
* 测试用户
**/
@RestController
@RequestMapping("/user")
public class EmployeeController {

    @Autowired
    private EmployeeService employeeService;

    @RequestMapping("getUser/{id}")
    public Employee queryById(@PathVariable int id){

        return employeeService.queryById(id);
    }

    @RequestMapping("queryAll")
    public List<Employee> queryAll(){

        return employeeService.queryAll();
    }
}
